package sudokuTest;

import sudoku.ClassicGrid;
import java.util.ArrayList;
import junit.framework.Assert;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import sudoku.ClassicGridSolution;
import static org.junit.Assert.*;

/**
 * Tests ...
 * @author Taras basiuk.
 */
public class ClassicGridSolutionTest {
    
    public ClassicGridSolutionTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }

    /**
     * Test of run method, of class ClassicGridSolution.
     */
    @Test
    public void testRun() {
        System.out.println("run");
        
        ClassicGrid grid = ClassicGrid.makeSolvableGrid(4, 0);        
        
        grid.printGrid();
        
        grid.randomCellErase(160);
        
        System.out.println();
        grid.printGrid();
        
        ClassicGridSolution solution = new ClassicGridSolution(grid);
        solution.run();
        
        System.out.println(solution.getPercentageCovered());
        
        Assert.assertTrue(solution.getNumSolFound() > 0);
    }
}
